package com.cn.ycy.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.PostConstruct;

@Controller
@RequestMapping("proproties")
//@PropertySource(value = {"classpath:custom.properties"})
@ConfigurationProperties(prefix = "rdfa.bp")
public class ProprotiesController {

  Logger logger = LoggerFactory.getLogger(this.getClass());

  //如果没有配合 @PropertySource 导入配置文件,就无法感知这个配置项。
  @Value("${rdfa.bp.callback.url:}")
  private String bpCallbackUrl;

  @PostConstruct
  public void postConstruct() {
    logger.warn(bpCallbackUrl);
  }

}
